﻿using System.Runtime.InteropServices;

namespace Ast.Core.Pe.Definitions
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public struct RelocationTypeOffset
    {
        public ushort Value { get; set; }

        public RelocationType Type
        {
            get { return (RelocationType) (Value >> 12); }
        }

        public uint Offset
        {
            get { return (uint) Value & 0xFFF; }
        }
    }
}